﻿<local:DocumentBase x:Class="WPFExcelReport.YCAWS02"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:INTEX.DataBase"
                    xmlns:dat="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core" 
                    xmlns:wep="clr-namespace:WPFExcelReport" 
                    Loaded="Window_Loaded" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    xmlns:tra="clr-namespace:WPFExcelReport.TranslationByMarkupExtension;assembly=ReflectionStudio.Core"
                    FontSize="14" 
                    Background="White" 
                    Title="面料信息" 
                    HorizontalAlignment="Stretch"
                    Margin="0,0,0,0" 
                    VerticalAlignment="Stretch"
                    >
    <local:DocumentBase.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:MaskPrice  x:Key="dprice"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:Divideby10000  x:Key="d10000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <db:SETINTEXDB  x:Key="SetData" />
        <db:SETINTEXDB  x:Key="SetQP" />
        <CollectionViewSource   x:Key="vwWS02" Source="{Binding Path=ICC_WS02,Source={StaticResource SetData}}" />        
    </local:DocumentBase.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto" MinHeight="20"></RowDefinition>
            <RowDefinition Height="*" MinHeight="300"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="1*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Expander  Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
            Name="expLog" ExpandDirection="Down" IsExpanded="True">
            <StackPanel>               
                    <WrapPanel Width="1023" Height="38">
                        <Label Content="面料编号："    Width="80" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtARTICLE" Width="162" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="1"
                         Focusable="True" KeyUp="txtART_KeyUp" Background="YellowGreen" MaxLength="20" FontSize="16" Foreground="#FF141111" Height="33" />
                        <Label Content="类型："    Width="47" Margin="10,0,0,0"  HorizontalAlignment="Left"  FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtTYPE" Width="52" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="2"
                                      KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="16" Foreground="#FF141111" Height="33" />
                        <Label Content="大类："    Width="46" Margin="10,0,0,0"  HorizontalAlignment="Left"  FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtPRDGRP" Width="62" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="3"
                             KeyUp="txtART_KeyUp" Background="Pink" MaxLength="3" FontSize="16" Foreground="#FF141111" Height="33" />
                        <Label Content="色号："    Width="46" Margin="10,0,0,0"  HorizontalAlignment="Left"  FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtCOLOR" Width="128" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="4"
                                 KeyUp="txtART_KeyUp" Background="Pink" MaxLength="10" FontSize="16" Foreground="#FF141111" Height="33" />
                        <Label Content="供应商色号："    Width="97" Margin="10,0,0,0"  HorizontalAlignment="Left" FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                        <TextBox Name="txtSCOLOR" Width="135" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="5"
                                     KeyUp="txtART_KeyUp" Background="Pink" MaxLength="10" FontSize="16" Foreground="#FF141111" Height="33" />

                </WrapPanel>
                <WrapPanel Width="1023" Height="38">
                    <Label Content="供应商简称："    Width="97" Margin="10,0,0,0"  HorizontalAlignment="Left"  FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtSUPP" Width="156" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="6"
                                     KeyUp="txtART_KeyUp" Background="Pink" MaxLength="10" FontSize="16" Foreground="#FF141111" Height="33" />
                    <Label Content="供应商品种："    Width="107" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="16" VerticalAlignment="Center" Foreground="#FF141111" />
                    <TextBox Name="txtSART" Width="222" Margin="10,0,0,0"  HorizontalAlignment="Left" CharacterCasing="Upper" Panel.ZIndex="7"
                                     KeyUp="txtART_KeyUp" Background="Pink" MaxLength="15" FontSize="16" Foreground="#FF141111" Height="33" />

                    <Button  Height="30"  Width="30" Margin="10,0,0,0" Name="btnQuery" Click="btnQuery_Click" KeyboardNavigation.TabIndex="8" IsDefault="True" TabIndex="13">
                        <Button.Background>
                            <ImageBrush ImageSource="Images/Search.png" />
                        </Button.Background>
                    </Button>
                    <Button Content="EXCEL" Margin="20,0,0,0" Name="btnReport" Width="47" Click="btnReport_Click" TabIndex="9" />

                </WrapPanel>
            </StackPanel>
        </Expander> 
        <FlowDocumentScrollViewer Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2"  >
                <FlowDocument> 
                    <Paragraph>
                    <DataGrid  AutoGenerateColumns="False"
                              EnableRowVirtualization="True"  
                              ItemsSource="{Binding Source={StaticResource ResourceKey=vwWS02}}"
                              HeadersVisibility="Column"
                              x:Name="MasterDg"    
                              Height="Auto" FontSize="14" FontFamily ="Times New Roman"
                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                              ScrollViewer.VerticalScrollBarVisibility="Auto" >
                        <!--ItemsSource="{Binding Source={StaticResource ResourceKey=vwWS02}}"-->
                        <!-- , Converter={StaticResource ResourceKey=gb2312}-->
                        <!-- waart,waprogrp,prdgrp,waartgrp,artgrp,supp,supplier,walohna,color,price,wauebm,
                            composition,width,wafgrqm,wafgrlfd,ffddik,ffddis,wafddim,waliefnr,wabez,wafbem-->
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding Path=WAART}" Header="面料编号" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=WAPROGRP}" Header="类型" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=PRDGRP}" Header="类型名" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=WAARTGRP}" Header="大类" Width="SizeToCells" MinWidth="30" />
                            <DataGridTextColumn Binding="{Binding Path=ARTGRP}" Header="大类名" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=SUPP}" Header="供应商简称" Width="SizeToCells" MinWidth="40" />
                            <DataGridTextColumn Binding="{Binding Path=SUPPLIER}" Header="供应商名称" Width="SizeToCells" MinWidth="30" MaxWidth="100"/>
                            <DataGridTextColumn Binding="{Binding Path=WALOHNA}" Header="供应商品种" Width="SizeToCells" MinWidth="50" />
                            <DataGridTextColumn Binding="{Binding Path=COLOR}" Header="颜色及供应商色号" Width="SizeToCells" MinWidth="60"/>
                            <DataGridTextColumn Binding="{Binding Path=PRICE}" Header="单价" Width="SizeToCells" MinWidth="30"/>
                            <DataGridTextColumn Binding="{Binding Path=WAUEBM}" Header="单位" Width="SizeToCells" MinWidth="30"/>
                            <DataGridTextColumn Binding="{Binding Path=COMPOSITION}" Header="成份" Width="SizeToCells" MinWidth="50"/>
                            <DataGridTextColumn Binding="{Binding Path=WIDTH}" Header="幅宽" Width="SizeToCells" MinWidth="30"/>
                            <DataGridTextColumn Binding="{Binding Path=WAFGRQM}" Header="克重平方" Width="SizeToCells" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=WAFGRLFD}" Header="克重米" Width="SizeToCells" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=FFDDIK}" Header="经密" Width="SizeToCells" MinWidth="30"/>
                            <DataGridTextColumn Binding="{Binding Path=FFDDIS}" Header="纬密" Width="SizeToCells" MinWidth="30"/>
                            <DataGridTextColumn Binding="{Binding Path=WAFDDIM}" Header="密度单位" Width="SizeToCells" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=WALIEFNR}" Header="供应商编号" Width="SizeToCells" MinWidth="40"/>
                            <DataGridTextColumn Binding="{Binding Path=WABEZ}" Header="面料描述" Width="SizeToCells" MinWidth="60"/>
                            <DataGridTextColumn Binding="{Binding Path=WAFBEM}" Header="纱支" Width="SizeToCells" MinWidth="40"/>
                        </DataGrid.Columns>
                    </DataGrid > 
                    </Paragraph>
                </FlowDocument>
            </FlowDocumentScrollViewer>     
    </Grid>
</local:DocumentBase>